package com.coderlin.controller;

import com.coderlin.entities.Send;
import com.coderlin.service.SendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * <Description> <br>
 *
 * @author Coder_Lin<br>
 * @version 1.0<br>
 * @taskId: <br>
 * @createDate 2021/07/28 11:09 <br>
 * @see com.coderlin.controller <br>
 */
@Controller
@RequestMapping("/send")
public class SendController {

    @Autowired
    private SendService sendService;

    @RequestMapping("/listSend")
    public String sendList(Model model){
        List<Send> sends = sendService.sendList();
        model.addAttribute("sendList",sends);

        return "sendList";
    }

    @RequestMapping("/searchSend")
    public String searchSend(String workerName,Model model){
        List<Send> sends = sendService.searchSend(workerName);
        model.addAttribute("sendList",sends);

        return "sendList";
    }
}
